<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let input = `1 6 4 4
        3 5 3 4
        0 3 7 3`

        let sql = input.split('\n').map(v => v.trim().split(' ').map(j => parseInt(j)))
        let list = []
        sql.forEach((v, i) => {
            list[i] = [[v[0], v[0] + v[2]].sort((a, b) => a - b), [v[1], v[1] - v[3]].sort((a, b) => a - b)]
        })
        let res = 0
        let new_lis = []

        console.log(list);

        function xiangjiao(x1, x2, x3, x4, y1, y2, y3, y4) {
            if (((x1 > x3 && x1 < x4) || (x2 > x3 && x2 < x4)) && ((y1 > y3 && y1 < y4) || (y2 > y3 && y2 < y4))) {
                let x = [x1, x2, x3, x4].sort((a, b) => a - b)
                let y = [y1, y2, y3, y4].sort((a, b) => a - b)
                x.pop()
                x.shift()
                y.pop()
                y.shift()
                new_lis = [[...x], [...y]]
                
                return true
            }
            return false

        }

        if (xiangjiao(...list[0][0], ...list[1][0], ...list[0][1], ...list[1][1])) {     
            
            if (xiangjiao(...new_lis[0], ...list[2][0], ...new_lis[1], ...list[2][1])) {
                res = Math.abs(new_lis[0][0] - new_lis[0][1]) * Math.abs(new_lis[1][0] - new_lis[1][1])
            } else {
                console.log(-1);

            }
        } else {
            console.log(-1);
        }

        console.log(res);




    </script>
</body>

</html>